package com.example.redis_redisson_demo.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class RedissonProperties {
    @ConfigurationProperties(value = "spring.redisson.single")
    @Component
    @Data
    public static class RedissonSingleProperties {
        private String node;
    }

    @ConfigurationProperties(value = "spring.redisson.master-slave")
    @Component
    @Data
    public static class RedissonMasterSlaveProperties{
        private String master;
        private List<String> slave;
    }

    @ConfigurationProperties(value = "spring.redisson.sentinel")
    @Component
    @Data
    public static class RedissonSentinelProperties{
        private List<String> nodes;
    }

    @ConfigurationProperties(value = "spring.redisson.cluster")
    @Component
    @Data
    public static class RedissonClusterProperties{
        private List<String> nodes;
    }
}
